<style>
h1{text-align:center;}
p.error{color:red !important}
</style>
<?php
if(!$this->Admin_model->check_trung(array('ip'=>$this->input->ip_address()),'users')){ 
    echo '<h1 style="color:red">Ip already exists !</h1>';               
}else{   

?>
<form method="post" action="<?php echo base_url('mobile/register');?>"  data-ajax="false">  
    <h1>Register</h1>                
    <ul data-role="listview" data-inset="true">
        <li data-icon="false"><a href="#">
        <label for="username">Username*:
        <?php 
            echo form_error('username'); 
            if($this->session->userdata('loidn'))
            {
                echo '<p class="error">'.$this->session->userdata('loidn').'</p>';
                $this->session->unset_userdata('loidn');
            }
        ?>
        </label>
                <input name="username" id="name2" value="<?php echo set_value('username'); ?>" autocomplete="on"  data-clear-btn="true" type="text"/>
                </a>
        </li>
        
        <li data-icon="false">
            <a href="#">
                <label for="password">Password*:<?php echo form_error('password');?></label>
                <input name="password" id="password" value="<?php echo set_value('password'); ?>" autocomplete="off" type="password"  data-clear-btn="true"/>
            </a>
        </li>
        
         <li data-icon="false">
            <a href="#">                        
                <label for="email-2">Email*:<?php echo form_error('email');?></label>
                <input data-clear-btn="true" name="email" id="email-2" value="<?php echo set_value('email'); ?>" type="email"/>
            </a>
        </li>
        <!--
        <li data-icon="false">
            <a href="#"> 
                <label for="slider2">Term off service:</label>
                <select name="slider2" id="slider2" data-role="slider">
                    <option value="no">No</option>
                    <option value="yes">Yes</option>                                
                </select>
            </a>
         </li>
         -->
        <li data-icon="false"  style="background:#F6F6F6 !important;">                        
             <fieldset class="ui-grid-a">
                    <div class="ui-block-a"><input  id="dangnhap" value="Register" data-theme="c" type="submit"/></div>
                    <div class="ui-block-b"><input id="btnlogin"  value="Login" data-theme="d" type="reset"/></div>
                </fieldset>                        
        </li>
        
    </ul>
    </form>
<script>
$(document).ready(function(){
    var url_reg='<?php echo base_url('mobile/login');?>';  
  $('#btnlogin').on('click',function(){
    window.location.href = url_reg;
    return false;
  })  

});
</script>
<?php } ?>